package interfaces;

import com.example.bottest.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;

public class Preparation extends Activity implements View.OnTouchListener, View.OnClickListener {
	private Button importer = null;
	private Button export = null;
	private Button edit = null;
	private Button visualiser = null;
	private Button editerElem = null;
	private Button editerElemPres = null;
	Intent intent;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.preparation);

		importer = (Button) findViewById(R.id.image); //settings for our "find devices" button 
		importer.setOnTouchListener(this);
		importer.setOnClickListener(this);
		
		export = (Button) findViewById(R.id.exporter); //settings for our "find devices" button 
		export.setOnTouchListener(this);
		export.setOnClickListener(this);
		
		edit = (Button) findViewById(R.id.config); //settings for our "find devices" button 
		edit.setOnTouchListener(this);
		edit.setOnClickListener(this);
		
		visualiser = (Button) findViewById(R.id.visualiser); //settings for our "find devices" button 
		visualiser.setOnTouchListener(this);
		visualiser.setOnClickListener(this);
		
		editerElem = (Button) findViewById(R.id.editerElem); //settings for our "find devices" button 
		editerElem.setOnTouchListener(this);
		editerElem.setOnClickListener(this);
		
		editerElemPres = (Button) findViewById(R.id.editerElemPres); //settings for our "find devices" button 
		editerElemPres.setOnTouchListener(this);
		editerElemPres.setOnClickListener(this);
	}

	@Override
	public void onClick(View arg0) {
		switch(arg0.getId()) {
		case R.id.image:
			//setProgressBarIndeterminateVisibility(true);   //When the user clicks on the "scann" button we start a discovery
			intent = new Intent(Preparation.this, Import.class);
			startActivity(intent);
			break;
		case R.id.exporter:
			intent = new Intent(Preparation.this, Export.class);
			startActivity(intent);
			break;
		case R.id.config:
			intent = new Intent(Preparation.this, EditCarte.class);
			startActivity(intent);
			break;
		case R.id.visualiser:
			intent = new Intent(Preparation.this, Trajectoire.class);
			startActivity(intent);
			break;
		case R.id.editerElem:
			intent = new Intent(Preparation.this, EditElemDispo.class);
			startActivity(intent);
			break;
		case R.id.editerElemPres:
			intent = new Intent(Preparation.this, EditElemPres.class);
			startActivity(intent);
			break;
		}
	}

	@Override
	public boolean onTouch(View arg0, MotionEvent arg1) {
		// TODO Auto-generated method stub
		return false;
	}
}
